<?php
require_once 'dbo.php';
require_once 'json.php';
if (empty ( $_GET ['id'] )) {
	die ( 'parameter error.' );
} else {
	$type = $_GET ['type'];
	if (empty ( $type )) {
		$type = 'NORMAL';
	}
	$parent_id = $_GET ['id'];
	echo getsubmenu ( $parent_id, $type);
}
/**
 * 
 * 获取子菜单
 * @param string $parent_id
 * @param string $type
 */
function getsubmenu($parent_id, $type) {
	$sql = 'SELECT * FROM eccg_menu WHERE ID LIKE \'' . $parent_id . '__\' AND TYPE=\'' . $type . '\' ORDER BY ID';
	$dbo = new DBOperate ();
	$result = $dbo->query ( $sql );	
	$json = result2json($result);
	return $json;
}
?>